// Decompiled by Jad v1.5.7f. Copyright 2000 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/SiliconValley/Bridge/8617/jad.html
// Decompiler options: packimports(3) 
// Source File Name:   Element.java

package com.iphaeton.lms.course.scorm12.datamodel;

import com.iphaeton.lms.course.scorm12.DebugIndicator;
import java.io.PrintStream;
import java.io.Serializable;

public class Element
    implements Serializable
{

    public Element(String inValue, String inType, String inVocab, boolean writeableFlag, boolean readableFlag, boolean mandatoryFlag)
    {
        value = inValue;
        type = inType;
        vocabularyType = inVocab;
        writeable = writeableFlag;
        readable = readableFlag;
        if(inValue.equalsIgnoreCase(""))
            initialized = false;
        else
            initialized = true;
        mandatory = mandatoryFlag;
        implemented = true;
    }

    public Element()
    {
        value = new String("");
        type = new String("");
        vocabularyType = new String("");
        writeable = false;
        readable = false;
        initialized = false;
        implemented = false;
        mandatory = false;
    }

    public boolean isWriteable()
    {
        return writeable;
    }

    public boolean isImplemented()
    {
        return implemented;
    }

    public boolean isInitialized()
    {
        return initialized;
    }

    public boolean isReadable()
    {
        return readable;
    }

    public boolean isMandatory()
    {
        return mandatory;
    }

    public String getVocabularyType()
    {
        return vocabularyType;
    }

    public String getValue()
    {
        return value;
    }

    public void setValue(String inValue)
    {
        value = inValue;
        initialized = true;
    }

    public String getType()
    {
        return type;
    }

    protected void setElement(Element e)
    {
        type = e.getType();
        value = e.getValue();
        vocabularyType = e.getVocabularyType();
        implemented = e.isImplemented();
        initialized = e.isInitialized();
        mandatory = e.isMandatory();
        readable = e.isReadable();
        writeable = e.isWriteable();
    }

    public void showElement()
    {
        if(_Debug)
        {
            System.out.println("     Value         " + getValue());
            System.out.println("     Type          " + getType());
            System.out.println("     Vocab Type    " + getVocabularyType());
            System.out.println("     Writeable     " + isWriteable());
            System.out.println("     Readable      " + isReadable());
            System.out.println("     Mandatory     " + isMandatory());
            System.out.println("     Implemented   " + isImplemented());
            System.out.println("     Intialized    " + isInitialized());
        }
    }

    private static final long serialVersionUID = 0xf606facff201017bL;
    private static boolean _Debug;
    private String value;
    private String type;
    private boolean writeable;
    private boolean implemented;
    private boolean initialized;
    private boolean readable;
    private boolean mandatory;
    private String vocabularyType;

    static 
    {
        _Debug = DebugIndicator.ON;
    }
}
